using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace TradingPlatform.IB.Utility
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }

        public MainForm(string instruction):this()
        {
            UtilityGui utilityGui;
            switch (instruction.ToLower())
            {
                case KeyWordsInstruction.ReportPnl:
                    utilityGui = new UtilityGui(new TradingKernel_SaveAccountUpdate(true));
                    utilityGui.ShowDialog();
                    utilityGui.Dispose();
                    break;
                case KeyWordsInstruction.HistoricalData:
                    utilityGui = new UtilityGui(new TradingKernel_SaveHistoricalData(true));
                    utilityGui.ShowDialog();
                    utilityGui.Dispose();
                    break;
                default:
                    break;
            }
        }

        private void buttonGetContractDetails_Click(object sender, EventArgs e)
        {
            UtilityGui utilityGui = new UtilityGui(new TradingKernel_SaveContractDetails());
            utilityGui.ShowDialog();
            utilityGui.Dispose();
        }

        private void buttonGetAccountUpdate_Click(object sender, EventArgs e)
        {
            UtilityGui utilityGui = new UtilityGui(new TradingKernel_SaveAccountUpdate());
            utilityGui.ShowDialog();
            utilityGui.Dispose();
        }

        private void buttonGetHistoricalData_Click(object sender, EventArgs e)
        {
            UtilityGui utilityGui = new UtilityGui(new TradingKernel_SaveHistoricalData());
            utilityGui.ShowDialog();
            utilityGui.Dispose();
        }
    }
}